# -*- encoding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
_modified_time = 1291706373.2463369
_template_filename=u'/Users/joeldunham/old/onlinelinguisticdatabase/templates/base/index.html'
_template_uri=u'/base/index.html'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding='utf-8'
from webhelpers.html import escape
_exports = ['writeJavascriptToHead', 'colorsCSS', 'head', 'getMenuItemLink', 'title', 'topPrimaryMenu', 'getMenuClass', 'flash', 'topSecondaryMenu', 'header', 'login', 'footer', 'sideMenu', 'heading']


def _mako_get_namespace(context, name):
    try:
        return context.namespaces[(__name__, name)]
    except KeyError:
        _mako_generate_namespaces(context)
        return context.namespaces[(__name__, name)]
def _mako_generate_namespaces(context):
    # SOURCE LINE 333
    ns = runtime.Namespace(u'javascriptDefs', context._clean_inheritance_tokens(), templateuri=u'/base/javascriptDefs.html', callables=None, calling_uri=_template_uri, module=None)
    context.namespaces[(__name__, u'javascriptDefs')] = ns

def render_body(context,**pageargs):
    context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        _import_ns = {}
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'closeHelpDivScript', u'fillHelpDivScript'])
        url = _import_ns.get('url', context.get('url', UNDEFINED))
        h = _import_ns.get('h', context.get('h', UNDEFINED))
        self = _import_ns.get('self', context.get('self', UNDEFINED))
        KeyError = _import_ns.get('KeyError', context.get('KeyError', UNDEFINED))
        next = _import_ns.get('next', context.get('next', UNDEFINED))
        session = _import_ns.get('session', context.get('session', UNDEFINED))
        app_globals = _import_ns.get('app_globals', context.get('app_globals', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 2
        __M_writer(u'<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"\n"http://www.w3.org/TR/html4/strict.dtd">\n<html>\n<head>\n    ')
        # SOURCE LINE 7
        __M_writer(escape(h.stylesheet_link(url('/yui/2.8.2r1/reset-fonts-grids/reset-fonts-grids.css'))))
        __M_writer(u'\n    ')
        # SOURCE LINE 8
        __M_writer(escape(h.stylesheet_link(url('/css/main.css'))))
        __M_writer(u'\n    ')
        # SOURCE LINE 9
        __M_writer(escape(self.colorsCSS()))
        __M_writer(u'\n    ')
        # SOURCE LINE 10
        __M_writer(escape(h.javascript_link(url('/yui/2.8.2r1/yahoo-dom-event/yahoo-dom-event.js'))))
        __M_writer(u'\n    ')
        # SOURCE LINE 11
        __M_writer(escape(h.javascript_link(url('/yui/2.8.2r1/connection/connection_core-min.js'))))
        __M_writer(u'\n    ')
        # SOURCE LINE 12
        __M_writer(escape(h.javascript_link(url('/javascript/functions.js'))))
        __M_writer(u'\n    ')
        # SOURCE LINE 13
        __M_writer(escape(h.stylesheet_link(url('/yui/2.8.2r1/menu/assets/skins/sam/menu.css'))))
        __M_writer(u'\n    ')
        # SOURCE LINE 14
        __M_writer(escape(h.javascript_link(url('/yui/2.8.2r1/yahoo-dom-event/yahoo-dom-event.js'))))
        __M_writer(u'\n    ')
        # SOURCE LINE 15
        __M_writer(escape(h.javascript_link(url('/yui/2.8.2r1/container/container_core-min.js'))))
        __M_writer(u'\n    ')
        # SOURCE LINE 16
        __M_writer(escape(h.javascript_link(url('/yui/2.8.2r1/menu/menu-min.js'))))
        __M_writer(u'\n    ')
        # SOURCE LINE 17
        __M_writer(escape(self.writeJavascriptToHead()))
        __M_writer(u'\n\n')
        # SOURCE LINE 19

        if not session.has_key('user_username'):
            disabledDict = {
                'forms': ', disabled: true',
                'files': ', disabled: true',
                'collections': ', disabled: true',
                'dictionary': ', disabled: true',
                'people': ', disabled: true',
                'tags': ', disabled: true',
                'sources': ', disabled: true',
                'settings': ', disabled: true'
            }
        else:
            disabledDict = {}
            
        def disabled(key):
            try:
                return disabledDict[key]
            except KeyError:
                return u''
        
        
        __M_locals_builtin_stored = __M_locals_builtin()
        __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin_stored[__M_key]) for __M_key in ['disabled','disabledDict'] if __M_key in __M_locals_builtin_stored]))
        # SOURCE LINE 39
        __M_writer(u'\n\n    <script type="text/javascript">\n        YAHOO.util.Event.onDOMReady(function () {\n\n            var aItemData = [\n                {text: "Forms", url: \'')
        # SOURCE LINE 45
        __M_writer(escape(url(controller='form', action='browse')))
        __M_writer(u"'")
        __M_writer(escape(disabled('forms')))
        __M_writer(u', submenu: {id: "formmenu",\n                    itemdata: [\n                        {text: "Add a Form", helptext: "(a)", url: \'')
        # SOURCE LINE 47
        __M_writer(escape(url(controller='form', action='add')))
        __M_writer(u'\'},\n                        {text: "Search Forms", helptext: "(s)", url: \'')
        # SOURCE LINE 48
        __M_writer(escape(url(controller='form', action='search')))
        __M_writer(u'\'},\n                        {text: "Browse Forms", helptext: "(f)", url: \'')
        # SOURCE LINE 49
        __M_writer(escape(url(controller='form', action='browse')))
        __M_writer(u'\'}\n                    ]}\n                },\n                {text: "Files", url: \'')
        # SOURCE LINE 52
        __M_writer(escape(url(controller='file', action='browse')))
        __M_writer(u"'")
        __M_writer(escape(disabled('files')))
        __M_writer(u', submenu: {id: "filemenu",\n                    itemdata: [\n                        {text: "Add a File", helptext: "(q)", url: \'')
        # SOURCE LINE 54
        __M_writer(escape(url(controller='file', action='add')))
        __M_writer(u'\'},\n                        {text: "Search Files", helptext: "(w)", url: \'')
        # SOURCE LINE 55
        __M_writer(escape(url(controller='file', action='search')))
        __M_writer(u'\'},\n                        {text: "Browse Files", helptext: "(r)", url: \'')
        # SOURCE LINE 56
        __M_writer(escape(url(controller='file', action='browse')))
        __M_writer(u'\'}\n                    ]}\n                },\n                {text: "Collections"')
        # SOURCE LINE 59
        __M_writer(escape(disabled('collections')))
        __M_writer(u", url: '")
        __M_writer(escape(url(controller='collection', action='browse')))
        __M_writer(u'\',\n                    submenu: {id: "collectionmenu", itemdata: [\n                        {text: "Add a Collection", helptext: "(z)",\n                            url: \'')
        # SOURCE LINE 62
        __M_writer(escape(url(controller='collection', action='add')))
        __M_writer(u'\'},\n                        {text: "Search Collections", helptext: "(x)",\n                            url: \'')
        # SOURCE LINE 64
        __M_writer(escape(url(controller='collection', action='search')))
        __M_writer(u'\'},\n                        {text: "Browse Collections", helptext: "(c)",\n                            url: \'')
        # SOURCE LINE 66
        __M_writer(escape(url(controller='collection', action='browse')))
        __M_writer(u'\'}\n                    ]}\n                },\n                {text: "Dictionary"')
        # SOURCE LINE 69
        __M_writer(escape(disabled('dictionary')))
        __M_writer(u", url: '")
        __M_writer(escape(url(controller='dictionary', action='browse')))
        __M_writer(u'\',\n                    submenu: {id: "dictionarymenu", itemdata: [\n                        {text: "Search Dictionary", url: \'')
        # SOURCE LINE 71
        __M_writer(escape(url(controller='dictionary', action='search')))
        __M_writer(u'\'},\n                        {text: "Browse Dictionary", helptext: "(d)",\n                            url: \'')
        # SOURCE LINE 73
        __M_writer(escape(url(controller='dictionary', action='browse')))
        __M_writer(u'\'}\n                    ]}\n                },\n                {text: "People", url: \'')
        # SOURCE LINE 76
        __M_writer(escape(url(controller='people', action='index')))
        __M_writer(u"'")
        __M_writer(escape(disabled('people')))
        __M_writer(u',\n                    submenu: {id: "peoplemenu", itemdata: [\n                        {text: "View All", helptext: "(p)", url: \'')
        # SOURCE LINE 78
        __M_writer(escape(url(controller='people', action='index')))
        __M_writer(u'\'},\n                        {text: "Speakers", url: \'')
        # SOURCE LINE 79
        __M_writer(escape(url(controller='people', action='index', anchor='speakers')))
        __M_writer(u'\',\n                            submenu: {id: "speakersmenu", itemdata: [\n                                {text: "Add a Speaker", url: \'/speaker/add\'}\n                            ]}\n                        },\n                        {text: "Users", url: \'/people#users\',\n                            submenu: {id: "usersmenu", itemdata: [\n                                {text: "Add a User", url: \'/researcher/add\'}\n                            ]}\n                        }\n                    ]}\n                },\n                {text: "Tags", url: \'/tag\'')
        # SOURCE LINE 91
        __M_writer(escape(disabled('tags')))
        __M_writer(u', submenu: {id: "tagsmenu", itemdata: [\n                        {text: "View All", helptext: "(t)", url: \'/tag\'},\n                        {text: "Keywords", url: \'/tag#keywords\',\n                            submenu: {id: "keywordsmenu", itemdata: [\n                                {text: "Add a Keyword", url: \'/key/add\'}\n                            ]}\n                        },\n                        {text: "Syntactic Categories", url: \'/tag#categories\'')
        # SOURCE LINE 98
        __M_writer(escape(disabled('categories')))
        __M_writer(u',\n                            submenu: {id: "categoriesmenu", itemdata: [\n                                {text: "Add a Category", url: \'/category/add\'}\n                            ]}\n                        },\n                        {text: "Elicitation Methods", url: \'/tag#methods\'')
        # SOURCE LINE 103
        __M_writer(escape(disabled('methods')))
        __M_writer(u',\n                            submenu: {id: "methodsmenu", itemdata: [\n                                {text: "Add an Elicitation Method", url: \'/method/add\'}\n                            ]}\n                        }\n                    ]}\n                },\n                {text: "Sources", url: \'/source\'')
        # SOURCE LINE 110
        __M_writer(escape(disabled('sources')))
        __M_writer(u', submenu: {id: "sourcesmenu", itemdata: [\n                        {text: "Add a Source", url: \'/source/add\'},\n                        {text: "Browse Sources", url: \'/source\'}\n                    ]}\n                },\n                {text: "Help", url: \'/help/applicationhelp\'')
        # SOURCE LINE 115
        __M_writer(escape(disabled('help')))
        __M_writer(u',\n                    submenu: {id: "helpmenu", itemdata: [\n                        {text: "Help Page", helptext: \'(h)\', url: \'/help/applicationhelp\'},\n                        {text: "OLD User Guide", url: \'/help/olduserguide\'}\n                    ]}\n                },\n                {text: "Settings", url: \'/settings\'')
        # SOURCE LINE 121
        __M_writer(escape(disabled('settings')))
        __M_writer(u',\n                    submenu: {id: "settingsmenu", itemdata: [\n                        {text: "View Settings", url: \'/settings\'},\n                        {text: "Edit Settings", url: \'/settings/edit\'}\n                    ]}\n                },\n                {text: "Account"')
        # SOURCE LINE 127
        __M_writer(escape(disabled('account')))
        __M_writer(u', submenu: {id: "accountmenu", itemdata: [\n')
        # SOURCE LINE 128
        if session.has_key('user_id'):
            # SOURCE LINE 129
            __M_writer(u'                        {text: "My Page", url: \'/researcher/view/')
            __M_writer(escape(session['user_id']))
            __M_writer(u'\',\n                            submenu: {id: "mypagemenu", itemdata: [\n                                {text: "Edit My Page", url: \'/researcher/edit/')
            # SOURCE LINE 131
            __M_writer(escape(session['user_id']))
            __M_writer(u'\'}\n                            ]}\n                        },\n                        {text: "My Settings", url: \'/researcher/settings/')
            # SOURCE LINE 134
            __M_writer(escape(session['user_id']))
            __M_writer(u'\',\n                            submenu: {id: "mysettingsmenu", itemdata: [\n                                {text: "Edit My Settings",\n                                    url: \'/researcher/editsettings/')
            # SOURCE LINE 137
            __M_writer(escape(session['user_id']))
            __M_writer(u'\'}\n                            ]}\n                        },\n                        {\n                            text: "My Memory",\n                            url: \'')
            # SOURCE LINE 142
            __M_writer(escape(url(controller='memory', action='index')))
            __M_writer(u'\',\n                            helptext: \'(m)\'\n                        },\n                        {text: "Logout", helptext: \'(l)\', url: \'/login/logout\'}\n')
            # SOURCE LINE 146
        else:
            # SOURCE LINE 147
            __M_writer(u'                        {text: "Login", helptext: \'(l)\', url: \'/login/login\'}\n')
            pass
        # SOURCE LINE 149
        __M_writer(u'                    ]}\n                }\n            ];\n            var oMenuBar = new YAHOO.widget.MenuBar("mymenubar", {\n                autosubmenudisplay: true});\n            oMenuBar.addItems(aItemData);\n            oMenuBar.render(\'topmenubar\');\n\n            function getEmptyAnchor(item)\n            {\n                var temp = \'\';\n                if (item.hasOwnProperty(\'helptext\'))\n                {\n                    temp = \'<a href="\' + item[\'url\'] + \'" accesskey="\' +\n                        item[\'helptext\'].charAt(1) + \'"></a>\\n\';\n                }\n                return temp;\n            }\n            \n            function getAccessKey(itemList)\n            {\n                var temp = \'\';\n                for (var i = 0; i < itemList.length; i++) \n                {\n                    var item = itemList[i];\n                    temp += getEmptyAnchor(item);\n                    if (item.hasOwnProperty(\'submenu\'))\n                    {\n                        temp += getAccessKey(item[\'submenu\'][\'itemdata\']);\n                    }\n                }\n                return temp;\n            }\n            document.getElementById(\'keyboardshortcuts\').innerHTML = getAccessKey(aItemData);\n        });\n    </script>\n    <title>')
        # SOURCE LINE 185
        __M_writer(escape(self.title()))
        __M_writer(u'</title>\n</head>\n\n')
        # SOURCE LINE 188

        topPrimaryMenuItems = app_globals.getTopPrimaryMenuItems()
        topSecondaryMenuItems = app_globals.getTopSecondaryMenuItems(url.current())
        sideMenuItems = app_globals.sideMenuItems
        activeMenuItems = app_globals.getActiveMenuItems(url.current())
        
        
        __M_locals_builtin_stored = __M_locals_builtin()
        __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin_stored[__M_key]) for __M_key in ['topSecondaryMenuItems','activeMenuItems','topPrimaryMenuItems','sideMenuItems'] if __M_key in __M_locals_builtin_stored]))
        # SOURCE LINE 193
        __M_writer(u'\n\n\n<body class="yui-skin-sam">\n<a name="top"></a>\n<div id="doc">\n    <div id="hd">')
        # SOURCE LINE 199
        __M_writer(escape(self.header()))
        __M_writer(u'</div>\n    <div id="topmenubar"></div>\n    <div id="keyboardshortcuts"></div>\n    <div id="bd">\n        ')
        # SOURCE LINE 203
        __M_writer(escape(self.heading()))
        __M_writer(u'\n        ')
        # SOURCE LINE 204
        __M_writer(escape(self.flash()))
        __M_writer(u'\n        ')
        # SOURCE LINE 205
        __M_writer(escape(next.body()))
        __M_writer(u'\n    </div>\n    <div id="ft">\n        ')
        # SOURCE LINE 208
        __M_writer(escape(self.footer()))
        __M_writer(u'\n    </div>\n</div>\n\n</body>\n</html>\n\n\n')
        # SOURCE LINE 220
        __M_writer(u'\n\n')
        # SOURCE LINE 236
        __M_writer(u'\n\n')
        # SOURCE LINE 246
        __M_writer(u'\n\n')
        # SOURCE LINE 248
        __M_writer(u'\n\n')
        # SOURCE LINE 250
        __M_writer(u'\n\n')
        # SOURCE LINE 270
        __M_writer(u'\n\n')
        # SOURCE LINE 280
        __M_writer(u'\n\n')
        # SOURCE LINE 292
        __M_writer(u'\n\n')
        # SOURCE LINE 328
        __M_writer(u'\n\n')
        # SOURCE LINE 330
        __M_writer(u'\n\n')
        # SOURCE LINE 345
        __M_writer(u'\n\n')
        # SOURCE LINE 355
        __M_writer(u'\n\n')
        # SOURCE LINE 369
        __M_writer(u'\n\n\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_writeJavascriptToHead(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'closeHelpDivScript', u'fillHelpDivScript'])
        __M_writer = context.writer()
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_colorsCSS(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'closeHelpDivScript', u'fillHelpDivScript'])
        url = _import_ns.get('url', context.get('url', UNDEFINED))
        h = _import_ns.get('h', context.get('h', UNDEFINED))
        app_globals = _import_ns.get('app_globals', context.get('app_globals', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 372
        __M_writer(u'\n    ')
        # SOURCE LINE 373
        __M_writer(escape(h.stylesheet_link(url('/css/colors/%s' % app_globals.colorsCSS))))
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_head(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'closeHelpDivScript', u'fillHelpDivScript'])
        __M_writer = context.writer()
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_getMenuItemLink(context,item,activeMenuItems):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'closeHelpDivScript', u'fillHelpDivScript'])
        url = _import_ns.get('url', context.get('url', UNDEFINED))
        self = _import_ns.get('self', context.get('self', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 222
        __M_writer(u'\n    <li><a ')
        # SOURCE LINE 223
        __M_writer(escape(self.getMenuClass(item, activeMenuItems)))
        __M_writer(u'')
        # SOURCE LINE 224
        __M_writer(u'        href="')
        __M_writer(escape(url(item['url'])))
        __M_writer(u'"')
        # SOURCE LINE 225
        if 'accesskey' in item:
            # SOURCE LINE 226
            __M_writer(u'        accesskey="')
            __M_writer(escape(item['accesskey']))
            __M_writer(u'"')
            pass
        # SOURCE LINE 228
        if 'title' in item:
            # SOURCE LINE 229
            __M_writer(u'        ')
            title = item['title'] 
            
            __M_writer(u'\n')
            # SOURCE LINE 230
            if 'accesskey' in item:
                # SOURCE LINE 231
                __M_writer(u'            ')
                title += ' <' + item['accesskey'] + '>' 
                
                __M_writer(u'\n')
                pass
            # SOURCE LINE 233
            __M_writer(u'        title="')
            __M_writer(escape(title))
            __M_writer(u'" \n')
            pass
        # SOURCE LINE 235
        __M_writer(u'    >')
        __M_writer(escape(item['name']))
        __M_writer(u'</a></li>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_title(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'closeHelpDivScript', u'fillHelpDivScript'])
        c = _import_ns.get('c', context.get('c', UNDEFINED))
        AttributeError = _import_ns.get('AttributeError', context.get('AttributeError', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 238
        __M_writer(u'\n ')
        # SOURCE LINE 239

        try:
          headingText = ': %s' % c.HTMLTitle
        except AttributeError:
          headingText = ''
         
        
        # SOURCE LINE 244
        __M_writer(u'\n OLD')
        # SOURCE LINE 245
        __M_writer(escape(headingText))
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_topPrimaryMenu(context,topPrimaryMenuItems,activeMenuItems):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'closeHelpDivScript', u'fillHelpDivScript'])
        self = _import_ns.get('self', context.get('self', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 272
        __M_writer(u'\n    <div id="topTopMenu">\n        <ul>\n')
        # SOURCE LINE 275
        for item in topPrimaryMenuItems:
            # SOURCE LINE 276
            __M_writer(u'                ')
            __M_writer(escape(self.getMenuItemLink(item, activeMenuItems)))
            __M_writer(u'')
            pass
        # SOURCE LINE 278
        __M_writer(u'        </ul>\n    </div>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_getMenuClass(context,item,activeMenuItems):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'closeHelpDivScript', u'fillHelpDivScript'])
        __M_writer = context.writer()
        # SOURCE LINE 216
        __M_writer(u'\n')
        # SOURCE LINE 217
        if item['id'] in activeMenuItems:
            # SOURCE LINE 218
            __M_writer(u"        class = 'selected'\n")
            pass
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_flash(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'closeHelpDivScript', u'fillHelpDivScript'])
        session = _import_ns.get('session', context.get('session', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 347
        __M_writer(u'\n')
        # SOURCE LINE 348
        if session.has_key('flash'):
            # SOURCE LINE 349
            __M_writer(u'    <div id="flash"><p>')
            __M_writer(escape(session.get('flash')))
            __M_writer(u'</p></div>\n    ')
            # SOURCE LINE 350

            del session['flash']
            session.save()
                
            
            # SOURCE LINE 353
            __M_writer(u'\n')
            pass
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_topSecondaryMenu(context,topSecondaryMenuItems,activeMenuItems):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'closeHelpDivScript', u'fillHelpDivScript'])
        self = _import_ns.get('self', context.get('self', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 282
        __M_writer(u'\n')
        # SOURCE LINE 283
        if topSecondaryMenuItems:
            # SOURCE LINE 284
            __M_writer(u'    <div id="topMenu">\n        <ul>\n')
            # SOURCE LINE 286
            for item in topSecondaryMenuItems:
                # SOURCE LINE 287
                __M_writer(u'                ')
                __M_writer(escape(self.getMenuItemLink(item, activeMenuItems)))
                __M_writer(u'')
                pass
            # SOURCE LINE 289
            __M_writer(u'        </ul>\n    </div>\n')
            pass
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_header(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'closeHelpDivScript', u'fillHelpDivScript'])
        url = _import_ns.get('url', context.get('url', UNDEFINED))
        h = _import_ns.get('h', context.get('h', UNDEFINED))
        app_globals = _import_ns.get('app_globals', context.get('app_globals', UNDEFINED))
        str = _import_ns.get('str', context.get('str', UNDEFINED))
        len = _import_ns.get('len', context.get('len', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 252
        __M_writer(u'\n ')
        # SOURCE LINE 253

        objectLanguageName = app_globals.objectLanguageName
        temp = str(2000 / (len(app_globals.objectLanguageName) + 1))
        titleWordsStyle = h.literal('style=\"font-size: %s%s;\"' % (temp, '%'))
        headerImageName = app_globals.headerImageName
        if headerImageName:
          style = h.literal(
              """style="background: #fff url('/file/retrieve/%s') no-repeat bottom
        left;" """ % headerImageName
          )
        else:
          style = ''
         
        
        # SOURCE LINE 265
        __M_writer(u'\n <div id="header" ')
        # SOURCE LINE 266
        __M_writer(escape(style))
        __M_writer(u'>\n  <div id="titleWords"><a href=\'')
        # SOURCE LINE 267
        __M_writer(escape(url(controller='home', action='index')))
        __M_writer(u"'>")
        __M_writer(escape(objectLanguageName))
        __M_writer(u'</a></div>\n  <div id="onlinelinguisticdatabase">Online Linguistic Database</div>\n </div>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_login(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'closeHelpDivScript', u'fillHelpDivScript'])
        url = _import_ns.get('url', context.get('url', UNDEFINED))
        session = _import_ns.get('session', context.get('session', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 357
        __M_writer(u'\n<div id="loginInfo">\n')
        # SOURCE LINE 359
        if session.has_key('user_username'):
            # SOURCE LINE 360
            __M_writer(u'  <a href="')
            __M_writer(escape(url(controller='researcher', action='view', id=session['user_id'])))
            __M_writer(u'"\n     title="Visit your personal page">')
            # SOURCE LINE 361
            __M_writer(escape(session['user_username']))
            __M_writer(u'</a>\n  <a href="')
            # SOURCE LINE 362
            __M_writer(escape(url(controller='login', action='logout')))
            __M_writer(u'" accesskey="l"\n     title="click here to log out of the system <l>"> | logout</a>\n')
            # SOURCE LINE 364
        else:
            # SOURCE LINE 365
            __M_writer(u'  <a href="')
            __M_writer(escape(url(controller='login', action='login')))
            __M_writer(u'" accesskey="l"\n     title="click here to log in to the system <l>">login</a>\n')
            pass
        # SOURCE LINE 368
        __M_writer(u'</div>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_footer(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'closeHelpDivScript', u'fillHelpDivScript'])
        closeHelpDivScript = _import_ns.get('closeHelpDivScript', context.get('closeHelpDivScript', UNDEFINED))
        fillHelpDivScript = _import_ns.get('fillHelpDivScript', context.get('fillHelpDivScript', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 332
        __M_writer(u'\n    ')
        # SOURCE LINE 334
        __M_writer(u'\n    ')
        # SOURCE LINE 335
        __M_writer(escape(closeHelpDivScript()))
        __M_writer(u'\n    ')
        # SOURCE LINE 336
        __M_writer(escape(fillHelpDivScript()))
        __M_writer(u'\n    <p><a href="#top">Top ^</a></p>\n    <div id="helpDiv">\n      <a href=\'#\' title="Close the help window" id="closeButton"\n         onclick="closeHelpDiv();return false;">x</a>\n      <div id="helpDivInner">\n        Help me\n      </div>\n    </div>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_sideMenu(context,sideMenuItems,activeMenuItems):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'closeHelpDivScript', u'fillHelpDivScript'])
        url = _import_ns.get('url', context.get('url', UNDEFINED))
        self = _import_ns.get('self', context.get('self', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 294
        __M_writer(u'\n        <p class="sideMenuLabel"><a href="')
        # SOURCE LINE 295
        __M_writer(escape(url('/form/browse')))
        __M_writer(u'"\n        title="browse all Forms <f>" accesskey="f"\n')
        # SOURCE LINE 297
        if '/form/browse' in url.current():
            # SOURCE LINE 298
            __M_writer(u"                class = 'selected'\n")
            pass
        # SOURCE LINE 300
        __M_writer(u'        >FORMS</a></p>\n        <ul>\n')
        # SOURCE LINE 302
        for item in sideMenuItems['form']:
            # SOURCE LINE 303
            __M_writer(u'                ')
            __M_writer(escape(self.getMenuItemLink(item, activeMenuItems)))
            __M_writer(u'')
            pass
        # SOURCE LINE 305
        __M_writer(u'        </ul>\n        <p class="sideMenuLabel"><a href="')
        # SOURCE LINE 306
        __M_writer(escape(url('/file/browse')))
        __M_writer(u'"\n        title="browse all Files <r>" accesskey="r"\n')
        # SOURCE LINE 308
        if '/file/browse' in url.current():
            # SOURCE LINE 309
            __M_writer(u"                class = 'selected'\n")
            pass
        # SOURCE LINE 311
        __M_writer(u'        >FILES</a></p>\n        <ul>\n')
        # SOURCE LINE 313
        for item in sideMenuItems['file']:
            # SOURCE LINE 314
            __M_writer(u'                ')
            __M_writer(escape(self.getMenuItemLink(item, activeMenuItems)))
            __M_writer(u'')
            pass
        # SOURCE LINE 316
        __M_writer(u'        </ul>\n        <p class="sideMenuLabel"><a href="')
        # SOURCE LINE 317
        __M_writer(escape(url('/collection/browse')))
        __M_writer(u'"\n        title="browse all Collections <c>" accesskey="c"\n')
        # SOURCE LINE 319
        if '/collection/browse' in url.current():
            # SOURCE LINE 320
            __M_writer(u"                class = 'selected'\n")
            pass
        # SOURCE LINE 322
        __M_writer(u'        >COLLECTIONS</a></p>\n        <ul>\n')
        # SOURCE LINE 324
        for item in sideMenuItems['collection']:
            # SOURCE LINE 325
            __M_writer(u'                ')
            __M_writer(escape(self.getMenuItemLink(item, activeMenuItems)))
            __M_writer(u'')
            pass
        # SOURCE LINE 327
        __M_writer(u'        </ul>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_heading(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'closeHelpDivScript', u'fillHelpDivScript'])
        __M_writer = context.writer()
        # SOURCE LINE 330
        __M_writer(u'<h1 class="heading"></h1>')
        return ''
    finally:
        context.caller_stack._pop_frame()


